package com.victualler.core.common.dto;


import com.victualler.core.common.enums.ChecKDataErrorEnum;

/**
 * @Author: Guoshichang
 * @Date: Create in 18:43 2018/4/5
 * @Discription: 传输json的包装对象
 */
public class ResultDto {
	//是否成功
    private boolean success;
    //反馈信息描述
    private String responseMessage;
    //反馈内容
    private Object data;
    
    /**
     * 不需要设置结果
     */
    public ResultDto() {
        this.success = true;
        this.responseMessage = ChecKDataErrorEnum.Success.getValue();
        this.data = null;
    }
    
    /**
     * 成功且需要设置结果
     * @param data
     */
    public ResultDto(Object data) {
        this();
        this.data = data;
    }
    
    /**
     * 出错时
     * @param responseMessage
     */
    public ResultDto(String responseMessage) {
		this.success = false;
		this.responseMessage = responseMessage;
		this.data = null;
	} 
    
    
	public boolean isSuccess() {
        return success;
    }

    public void setSuccess(boolean success) {
        this.success = success;
    }

     
    public String getResponseMessage() {
		return responseMessage;
	}
   
    public void setResponseMessage(String responseMessage) {
		this.responseMessage = responseMessage;
	}
    public void setData(Object data) {
		this.data = data;
	}
    public Object getData() {
		return data;
	}
    
}
